package jstudio.android.piratedefence;

import android.content.Context;
import android.app.Activity;
import android.widget.RelativeLayout;
import android.widget.ImageView;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;

public class PresentScene extends RelativeLayout implements AnimationListener{
	private Context ctx;
	private ImageView logo;
	private AlphaAnimation logoAni;
	private int duration;
	
	public PresentScene(Context context){
		super(context);
		ctx = context;
	}
	public void init(){
		logo = new ImageView(ctx);
		logo.setImageResource(R.drawable.logo);
		RelativeLayout.LayoutParams logoLP = new RelativeLayout.LayoutParams(100, 100);
		logoLP.addRule(RelativeLayout.CENTER_IN_PARENT);
		this.addView(logo, logoLP);
		logoAni = new AlphaAnimation(0.0f,1.0f);
		logoAni.setDuration(duration/2);
		logoAni.setRepeatCount(2);
		logoAni.setFillAfter(true);
	}
	
	public void setDuration(int d){
		duration = d;
	}

    public void onAnimationStart(Animation a){
    	
    } 
    public void onAnimationEnd(Animation a){
    	if(a==logoAni){
    		
    	}
    } 
    public void onAnimationRepeat(Animation a){
    	
    } 
}
